clear

**File Name Here:
use "C:\Users\Brendan\Desktop\Replication File_FPA\Main Data.dta" 

********************************************************************************
***************************MAIN MANUSCRIPT**************************************
********************************************************************************

**TABLE 1
//Model 1
logit prosanctions loggedmigrants, cluster(ccode)
estimates store MODEL1, title(Model 1)
//Model 2
logit prosanctions loggedmigrants libyabill iranbill, cluster(ccode)
estimates store MODEL2, title(Model 2)
//Model 3
logit prosanctions loggedmigrants libyabill iranbill i.ccode, cluster(ccode)
estimates store MODEL3, title(Model 3)
//Model 4
logit prosanctions loggedmigrants libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODEL4, title(Model 4)
//Model 5
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODEL5, title(Model 5)

estout MODEL1 MODEL2 MODEL3 MODEL4 MODEL5, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "results1.tex", replace style(tex)

**TABLE 2
//Model 6
logit prosanctions ln_transitstock_weighted if libyabill==1, cluster(ccode)
estimates store MODEL6, title(Model 6)
//Model 7
logit prosanctions ln_transitstock_weighted population unemployment gdpgrowth distance col if libyabill==1, cluster(ccode)
estimates store MODEL7, title(Model 7)
//Model 8
logit prosanctions migrants_plustransit_sd libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODEL8, title(Model 8)
//Model 9
logit prosanctions migrants_plustransit_sd population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODEL9, title(Model 9)

estout MODEL6 MODEL7 MODEL8 MODEL9, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "results2.tex", replace style(tex)

**FIGURE 1
qui logit prosanctions loggedmigrants population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
margins, at(loggedmigrants=(0(1)12)) atmean
marginsplot, xsize(10) ysize(9) addplot(hist loggedmigrants if e(sample), yaxis(2) xscale(range(0(1)12)) xlabel(0(1)12) yscale(range(0(.1)1)) ylabel() yscale(axis(2) range(0 .75) off) lc(white%0) fcolor(sand%25) recast(rbar)) recast(line) recastci(rarea) ciopts(fc(blue%30) lc(white%0)) xtitle(ln(Migrant Stock)) title("") ytitle(Predicted Probability of Voting in Favor of Sanctions) legend(off) graphregion(fcolor(white) lcolor(white))

********************************************************************************
**********************************APPENDIX**************************************
********************************************************************************

**TABLE A1
qui logit prosanctions loggedmigrants, cluster(ccode)
sutex prosanctions loggedmigrants migrantshare migrantshare2 ln_transitstock_weighted migrants_plustransit_sd ln_borderdetect libyabill iranbill population unemp gdpgrowth distance col immigrantpolicy RWPvoteshare  pincometax sstax  exportsGDP importsGDP logged_refugee lnremit if e(sample), minmax nobs

**TABLE A2
//Model A1
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col immigrantpolicy libyabill iranbill i.party, cluster(ccode)
estimates store MODELA1, title((A1))
//Model A2
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col RWPvoteshare libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA2, title((A2))
//Model A3
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col exportsGDP importsGDP libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA3, title((A3))
//Model A4
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col pincometax sstax libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA4, title((A4))
//Model A5
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col logged_refugee libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA5, title((A5))
//Model A6
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col lnremit libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA6, title((A6))

estout MODELA1 MODELA2 MODELA3 MODELA4 MODELA5 MODELA6, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "modelsa1_a6.tex", replace style(tex)

**FIGURE 2
coefplot MODELA1, bylabel(Model A1) ///
|| MODELA2, bylabel(Model A2) ///
|| MODELA3, bylabel(Model A3) ///
|| MODELA4, bylabel(Model A4) ///
|| MODELA5, bylabel(Model A5) ///
|| MODELA6, bylabel(Model A6) keep(loggedmigrants) nolabel xsize(10) ysize(9) xline(0) graphregion(fcolor(white) lcolor(white))

**TABLE A3
//Model A7
logit prosanctions loggedmigrants libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA7, title((A7))
//Model A8
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA8, title((A8))
//Model A9
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col immigrantpolicy libyabill iranbill i.party, cluster(ccode)
estimates store MODELA9, title((A9))
//Model A10
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col RWPvoteshare libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA10, title((A10))
//Model A11
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col exportsGDP importsGDP libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA11, title((A11))
//Model A12
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col pincometax sstax libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA12, title((A12))
//Model A13
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col logged_refugee libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA13, title((A13))
//Model A14
logit prosanctions loggedmigrants population unemployment gdpgrowth distance col lnremit libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA14, title((A14))

estout MODELA7 MODELA8 MODELA9 MODELA10 MODELA11 MODELA12 MODELA13 MODELA14, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "modelsa7_a14.tex", replace style(tex)

**TABLE A4
//Model A15
logit prosanctions migrantshare, cluster(ccode)
estimates store MODELA15, title((A15))
//Model A16
logit prosanctions migrantshare libyabill iranbill, cluster(ccode)
estimates store MODELA16, title((A16))
//Model A17
logit prosanctions migrantshare libyabill iranbill i.ccode, cluster(ccode)
estimates store MODELA17, title((A17))
//Model A18
logit prosanctions migrantshare libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA18, title((A18))
//Model A19
logit prosanctions migrantshare population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA19, title((A19))
//Model A20
logit prosanctions migrantshare population unemployment gdpgrowth distance col immigrantpolicy libyabill iranbill i.party, cluster(ccode)
estimates store MODELA20, title((A20))
//Model A21
logit prosanctions migrantshare population unemployment gdpgrowth distance col RWPvoteshare libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA21, title((A21))
//Model A22
logit prosanctions migrantshare population unemployment gdpgrowth distance col exportsGDP importsGDP libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA22, title((A22))
//Model A23
logit prosanctions migrantshare population unemployment gdpgrowth distance col pincometax sstax libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA23, title((A23))
//Model A24
logit prosanctions migrantshare population unemployment gdpgrowth distance col refugees_perhomepop libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA24, title((A24))
//Model A25
logit prosanctions migrantshare population unemployment gdpgrowth distance col lnremit libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA25, title((A25))

estout MODELA15 MODELA16 MODELA17 MODELA18 MODELA19 MODELA20 MODELA21 MODELA22 MODELA23 MODELA24 MODELA25, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "modelsa15_a25.tex", replace style(tex)

**TABLE A5
//Model A26
logit prosanctions migrantshare2, cluster(ccode)
estimates store MODELA26, title((A26))
//Model A27
logit prosanctions migrantshare2 libyabill iranbill, cluster(ccode)
estimates store MODELA27, title((A27))
//Model A28
logit prosanctions migrantshare2 libyabill iranbill i.ccode, cluster(ccode)
estimates store MODELA28, title((A28))
//Model A29
logit prosanctions migrantshare2 libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA29, title((A29))
//Model A30
logit prosanctions migrantshare2 population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA30, title((A30))
//Model A31
logit prosanctions migrantshare2 population unemployment gdpgrowth distance col immigrantpolicy libyabill iranbill i.party, cluster(ccode)
estimates store MODELA31, title((A31))
//Model A32
logit prosanctions migrantshare2 population unemployment gdpgrowth distance col RWPvoteshare libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA32, title((A32))
//Model A33
logit prosanctions migrantshare2 population unemployment gdpgrowth distance col exportsGDP importsGDP libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA33, title((A33))
//Model A34
logit prosanctions migrantshare2 population unemployment gdpgrowth distance col pincometax sstax libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA34, title((A34))
//Model A35
logit prosanctions migrantshare2 population unemployment gdpgrowth distance col refugees_pertotmigrants libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA35, title((A35))
//Model A36
logit prosanctions migrantshare2 population unemployment gdpgrowth distance col lnremit libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA36, title((A36))

estout MODELA26 MODELA27 MODELA28 MODELA29 MODELA30 MODELA31 MODELA32 MODELA33 MODELA34 MODELA35 MODELA36, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "modelsa26_a36.tex", replace style(tex)

**TABLE A6
bysort ccode bill: egen avgprosanctionsvote = mean(prosanctions)
collapse avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col immigrantpolicy RWPvoteshare exportsGDP importsGDP pincometax sstax logged_refugee lnremit, by(ccode bill)
//Model A37
fracreg logit avgprosanctionsvote loggedmigrants
estimates store MODELA37, title((A37))
//Model A38
fracreg logit avgprosanctionsvote loggedmigrants i.bill
estimates store MODELA38, title((A38))
//Model A39
fracreg logit avgprosanctionsvote loggedmigrants i.bill i.ccode
estimates store MODELA39, title((A39))
//Model A40
fracreg logit avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col i.bill i.ccode
estimates store MODELA40, title((A40))
//Model A41
fracreg logit avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col immigrantpolicy i.bill
estimates store MODELA41, title((A41))
//Model A42
fracreg logit avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col RWPvoteshare i.bill i.ccode
estimates store MODELA42, title((A42))
//Model A43
fracreg logit avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col exportsGDP importsGDP i.bill i.ccode
estimates store MODELA43, title((A43))
//Model A44
fracreg logit avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col pincometax sstax i.bill i.ccode
estimates store MODELA44, title((A44))
//Model A45
fracreg logit avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col logged_refugee i.bill i.ccode
estimates store MODELA45, title((A45))
//Model A46
fracreg logit avgprosanctionsvote loggedmigrants population unemployment gdpgrowth distance col lnremit i.bill i.ccode
estimates store MODELA46, title((A46))

estout MODELA37 MODELA38 MODELA39 MODELA40 MODELA41 MODELA42 MODELA43 MODELA44 MODELA45 MODELA46, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "modelsa37_a46.tex", replace style(tex)

*Table A7 (Mixed Effects)
//Re-upload uncollapsed data
clear
use "C:\Users\Brendan\Desktop\Replication File_FPA\Main Data.dta"

//Model A47
melogit prosanctions loggedmigrants libyabill iranbill i.party || ccode:
estimates store MODELA47, title((A47))
//Model A48
melogit prosanctions loggedmigrants population unemployment gdpgrowth distance col libyabill iranbill  || ccode:
estimates store MODELA48, title((A48))
//Model A49
melogit prosanctions loggedmigrants population unemployment gdpgrowth distance col immigrantpolicy libyabill iranbill i.party || ccode:
estimates store MODELA49, title((A49))
//Model A50
melogit prosanctions loggedmigrants population unemployment gdpgrowth distance col RWPvoteshare libyabill iranbill i.party || ccode:
estimates store MODELA50, title((A50))
//Model A51
melogit prosanctions loggedmigrants population unemployment gdpgrowth distance col exportsGDP importsGDP libyabill iranbill i.party || ccode:
estimates store MODELA51, title((A51))
//Model A52
melogit prosanctions loggedmigrants population unemployment gdpgrowth distance col pincometax sstax libyabill iranbill  i.party || ccode:
estimates store MODELA52, title((A52))
//Model A53
melogit prosanctions loggedmigrants population unemployment gdpgrowth distance col logged_refugee libyabill iranbill i.party || ccode:
estimates store MODELA53, title((A53))
//Model A54
melogit prosanctions loggedmigrants population unemployment gdpgrowth distance col lnremit libyabill iranbill i.party || ccode:
estimates store MODELA54, title((A54))

estout MODELA47 MODELA48 MODELA49 MODELA50 MODELA51 MODELA52 MODELA53 MODELA54, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "modelsa47_a54.tex", replace style(tex)

**TABLE A8
tab party, gen(partydum)
medeff (regress RWPvoteshare loggedmigrants population unemployment gdpgrowth distance col libyabill iranbill partydum1 partydum2 partydum3 partydum4 partydum5 partydum6 partydum7) (logit prosanctions loggedmigrants RWPvoteshare population unemployment gdpgrowth distance col libyabill iranbill partydum1 partydum2 partydum3 partydum4 partydum5 partydum6 partydum7), mediate(RWPvoteshare) treat(loggedmigrants 7.543026 10.486297) sims(1000) seed(23145) vce(cluster ccode) level(90)

**TABLE A9
medeff (regress lnremit loggedmigrants population unemployment gdpgrowth distance col libyabill iranbill partydum1 partydum2 partydum3 partydum4 partydum5 partydum6 partydum7) (logit prosanctions loggedmigrants lnremit population unemployment gdpgrowth distance col libyabill iranbill partydum1 partydum2 partydum3 partydum4 partydum5 partydum6 partydum7), mediate(lnremit) treat(loggedmigrants 7.543026 10.486297) sims(1000) seed(23145) vce(cluster ccode) level(90)

**TABLE A10
//Model A59
logit prosanctions ln_borderdetect, cluster(ccode)
estimates store MODELA59, title(Model A59)
//Model A60
logit prosanctions ln_borderdetect libyabill iranbill, cluster(ccode)
estimates store MODELA60, title(Model A60)
//Model A61
logit prosanctions ln_borderdetect libyabill iranbill i.ccode, cluster(ccode)
estimates store MODELA61, title(Model A61)
//Model A62
logit prosanctions ln_borderdetect libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA62, title(Model A62)
//Model A63
logit prosanctions ln_borderdetect population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELA63, title(Model A63)

estout MODELA59 MODELA60 MODELA61 MODELA62 MODELA63, cells(b(star fmt(3)) se(par fmt(3))) starlevels($^{+}$ 0.10 $^{*}$ 0.05 $^{**}$ 0.01 $^{***}$ 0.001) stats(N N_g r2, fmt(0 0 3) label(Observations Countries R$^2$)) label,  using "modelsa59_a63.tex", replace style(tex)

**TABLE A11
//See Do File titled "Sanctions and Emigration"

**TABLE A12
//Model I1
logit prosanctions loggedmigrants RWPvoteshare migrantstockXrwpvote population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELI1, title(Model I1)
//Model I2
logit prosanctions c.loggedmigrants##c.immigrantpolicy population unemployment gdpgrowth distance col libyabill iranbill i.party, cluster(ccode)
estimates store MODELI2, title(Model I2)
//Model I3
logit prosanctions loggedmigrants sstax migrantstockXsstax population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELI3, title(Model I3)
//Model I4
logit prosanctions migrantshare RWPvoteshare migrantshareXrwpvote population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELI4, title(Model I4)
//Model I5
logit prosanctions c.migrantshare##c.immigrantpolicy population unemployment gdpgrowth distance col libyabill iranbill i.party, cluster(ccode)
estimates store MODELI5, title(Model I5)
//Model I6
logit prosanctions migrantshare sstax migrantshareXsstax population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELI6, title(Model I6)

**TABLE A13
//Model I7
logit prosanctions migrantshare2 RWPvoteshare migrantshare2Xrwpvote population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELI7, title(Model I7)
//Model I8
logit prosanctions c.migrantshare2##c.immigrantpolicy population unemployment gdpgrowth distance col libyabill iranbill i.party, cluster(ccode)
estimates store MODELI8, title(Model I8)
//Model I9
logit prosanctions migrantshare2 sstax migrantshare2Xsstax population unemployment gdpgrowth distance col libyabill iranbill i.ccode i.party, cluster(ccode)
estimates store MODELI9, title(Model I9)
